#!/bin/bash
# date: Sat Jul 30 15:41:23 CST 2022
# author: xkl
read -p "输入用户名：" username
id $username &> /dev/null
if [ $? -eq 0 ];then
	echo -e "\e[32m${username}已存在\e[0m"
else	
	useradd $username
	echo "$username" | passwd --stdin $username &> /dev/null
	echo -e "\e[32m创建用户$username,密码为用户名\e[0m"
fi


